package com.qianfeng.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.qianfeng.dao.UserDao;
import com.qianfeng.pojo.User;

@Service
public class UserServiceImpl implements UserService {

	@Autowired
	private UserDao userDao;
	@Override
	public void addUser(User user) {
		userDao.save(user);//UserDao中虽然没有写函数，但是它继承了JpaRepository
		
	}
	@Override
	public User findUser(Integer id) {
		return userDao.findOne(id);
	}
	@Override
	public void deleteUser(Integer id) {
		userDao.delete(id);
		
	}

}
